package com.hyk.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyk.entity.UserOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyk.entity.request.OrderRequest;
import com.hyk.entity.response.OrderResponse;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hyk
 * @since 2021-03-23
 */
public interface UserOrderMapper extends BaseMapper<UserOrder> {

    void insertX(@Param("order") UserOrder order);

    List<UserOrder> selectUserOrder(@Param("id") long id);

    List<UserOrder> selectOrderTypeByTime(@Param("date") Date date, @Param("code") int code);

    Page<OrderResponse> allListPage(Page<OrderResponse> page, @Param("request") OrderRequest request);

    BigDecimal sumToBuy(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    Integer countOrderSum0();

    Integer countOrderSum1();
}
